home *** CD-ROM | disk | FTP | other *** search
- // Copyright (c)1995 Ray Dream, Inc. All Rights Reserved.
- /* $Id: COMLite.h 1.2 1996/09/27 21:06:18 DAMIEN Exp $ */
-
- ////////////////////////////////////////////////////////////////////////
- // First Light Source Example : Beams Light //
- //--------------------------------------------------------------------//
- // Declaration of the Beams Light Interface //
- ////////////////////////////////////////////////////////////////////////
-
-
- #ifndef __COMLITE__
- #define __COMLITE__
-
- #ifndef __I3DEXLIT__
- #include "I3DExLit.h"
- #endif
-
- // CLSID of Beams Light
- // to put in the Registration Database \CLSID\{...} = RDD COM BeamsLight
- // InprocServer = fullpathname to RDX file
- // F3472360-734D-101C-B801-04021C007002
- DEFINE_GUID(CLSID_BeamsLight, 0xF3472360L, 0x734D, 0x101C, 0xB8, 0x01, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
-
-
- // Light Data structure
- typedef struct LightData {
- short fHorApertureAngle; // Angular Limits of the light source
- short fVerApertureAngle; //
- NUM3D fIntensity; // Light source intensity
- short fNbBeamsHorizontally; // Number of Beams Horizontally and Vertically
- short fNbBeamsVertically; //
- COLOR3D fLightColor; // Default color
- short fBeamAperture; // Angular Limit of the singular Beam
- } LightData;
-
-
- // Beams Light Object :
- #undef INTERFACE
- #define INTERFACE BeamsLight
- class BeamsLight : public I3DExLightsource {
- public :
- BeamsLight();
- ~BeamsLight();
-
- // IUnknown Interface :
- STDMETHODIMP QueryInterface(THIS_ REFIID riid, LPVOID* ppvObj);
- STDMETHODIMP_(ULONG) AddRef(THIS);
- STDMETHODIMP_(ULONG) Release(THIS);
-
- // I3DExtension method :
- STDMETHODIMP_(I3DExtension*) Clone(THIS);
- STDMETHODIMP ShellUtilitiesInit(THIS_ IShUtilities* shellUtilities);
-
- // I3DExDataExchanger methods :
- STDMETHODIMP_(ExtensionDataMap*) GetExtensionDataMap(THIS);
- STDMETHODIMP_(void*) GetExtensionDataBuffer(THIS);
- STDMETHODIMP ExtensionDataChanged(THIS);
- STDMETHODIMP HandleEvent(THIS_ ULONG sourceID);
- STDMETHODIMP_(short) GetResID(THIS);
-
- // I3DExLightsource methods
- STDMETHODIMP SetTransform(THIS_ TRANSFORM3D* transform);
- STDMETHODIMP GetDirection(THIS_ VECTOR3D* position, VECTOR3D* resultDirection, NUM3D* resultDistance);
- STDMETHODIMP_(BOOLEAN) GetColor(THIS_ VECTOR3D* position, VECTOR3D* direction, NUM3D distance, COLOR3D* result, BOOLEAN* CallForShadowEffect);
- STDMETHODIMP_(BOOLEAN) IsVisibleInPerspective(THIS);
- STDMETHODIMP ShadowEffect(THIS_ NUM3D distance, COLOR3D* result);
- STDMETHODIMP_(LightTraceElement*) GetNewTrace(THIS_ short* nb);
- STDMETHODIMP_(ULONG) GetPrimitiveID(THIS);
- STDMETHODIMP ForEachShadowBuffer(THIS_ ForEachShadowBufferCallback proc, void* priv);
- STDMETHODIMP GetLightParameter(THIS_ long keyword, void* parameter);
-
- private :
- TRANSFORM3D fTransform; // Transformation Data (Local to Global and Global to Local)
- ULONG fCRef; // reference Counter
- LightData fData; // Light Data (see definition of LightData structure)
- NUM3D fHorAng,fVerAng; // NUM3D Value of the angle data.
- NUM3D fBeamLimit; // Limit of the single beam (cosinus)
- NUM3D fBeamAngle; // and in degree
- };
-
-
-
- #endif // __BEAMLGHT__
-
-